-- GENERATED SPELL FOR [Swirling Water Revenant] --


function spell0_32234(pUnit, Event) --@Drained,Self--
pUnit:FullCastSpellOnTarget(59820,pUnit)
pUnit:RegisterEvent('Sorts_32234', 15325, 1)
end

function spell1_32234(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(59522,pUnit)
pUnit:RegisterEvent('Sorts_32234', 587, 1)
end

function spell2_32234(pUnit, Event) --@Protective Bubble,Self--
pUnit:FullCastSpellOnTarget(54306,pUnit)
pUnit:RegisterEvent('Sorts_32234', 677, 1)
end

function spell3_32234(pUnit, Event) --@Water Blast,n/a--
pUnit:FullCastSpellOnTarget(59520,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32234', 533, 1)
end

function spell4_32234(pUnit, Event) --@Water Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(59521,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32234', 2500, 1)
end

function Sorts_32234(pUnit, Event)
local choix_sorts_32234 = math.random(0, 4)
if choix_sorts_32234 == 0 then
pUnit:RegisterEvent('spell0_32234', 1, 1)
end
if choix_sorts_32234 == 1 then
pUnit:RegisterEvent('spell1_32234', 1, 1)
end
if choix_sorts_32234 == 2 then
pUnit:RegisterEvent('spell2_32234', 1, 1)
end
if choix_sorts_32234 == 3 then
pUnit:RegisterEvent('spell3_32234', 1, 1)
end
if choix_sorts_32234 == 4 then
pUnit:RegisterEvent('spell4_32234', 1, 1)
end
end

function mob32234_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32234', math.random(1500, 3000), 1)
end

function mob32234_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32234_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32234_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32234, 1, 'mob32234_Action')
RegisterUnitEvent(32234, 2, 'mob32234_Leave')
RegisterUnitEvent(32234, 3, 'mob32234_Kill')
RegisterUnitEvent(32234, 4, 'mob32234_Die')
